package com.first.common.utils;


import java.util.ArrayList;
import java.util.List;

public class StringToListUtil {
    public static List<Integer> StringToList(String str) {
        str = str.replace("，", ",");
        str = str.replaceAll("[^0-9,]", "");
        // 分割字符串
        String[] strArray = str.split(",");
        // 转化为List<Integer>
        List<Integer> intList = new ArrayList<>();
        for (String s : strArray) {
            intList.add(Integer.parseInt(s));
        }
        return intList;
    }
}
